#ifndef _PHYSYCS_H_
#define _PHYSYCS_H_

#include "vector.h"
#include "matrix.h"

enum colider_type
{
	col_sphere,
	col_obb
};

class collider
{
public:
	collider(vector3 _pos,colider_type _type)
	{
		m_type = _type;
		m_pos = _pos;
		m_rot = vector3(0.0f,0.0f,0.0f);
	}
	virtual void set_pos(vector3 _pos)
	{
		m_pos = _pos;
	}
	vector3& get_pos()
	{
		return m_pos;
	}
	virtual void set_rot(vector3 _rot)
	{
		m_rot = _rot;
	}
	colider_type get_type(){return m_type;}

	virtual bool is_collide(collider* _col)=0;
	virtual bool is_collide(vector3& _point)=0;
protected:
	vector3 m_pos;
	vector3 m_rot;
	colider_type m_type;
};

class bbox: public collider
{
public:
	bbox(vector3 _pos,vector3 _size);

	bool is_collide(collider* _col);
	bool is_collide(vector3& _point);

protected:
	vector3 m_size;
};

class bsphere: public collider
{
public:
	bsphere(vector3 _pos,float _rad);

	bool is_collide(collider* _col);
	bool is_collide(vector3& _point);

	float get_radius(){return m_radius;}

protected:
	float   m_radius;
};

#endif